import os
from dotenv import load_dotenv

load_dotenv()

class Config:

    # 大模型配置
    LLM_URI = os.getenv("LLM_URI","")
    LLM_API_KEY = os.getenv("LLM_API_KEY", "")
    LLM_MODEL = os.getenv("LLM_MODEL")
    USE_THINKING = os.getenv("USE_THINKING", "false").lower() == "true"
    LLM_TIMEOUT = int(os.getenv("LLM_TIMEOUT", 60))

    # 向量模型
    EMBEDDING_MODEL = os.getenv("EMBEDDING_MODEL")
    EMBEDDING_DIM = int(os.getenv("EMBEDDING_DIM", 768))
    DEVICE = os.getenv("DEVICE", "cpu")

    # 记忆存储类型
    MEMORY_STORE_TYPE = os.getenv("MEMORY_STORE_TYPE", "inmemory")

    # PG数据库连接
    USER_NAME = os.getenv("USER_NAME", "postgres")
    PASSWORD = os.getenv("PASSWORD", "postgres")
    HOST = os.getenv("HOST", "localhost")
    PORT = os.getenv("PORT", "5432")
    DBNAME = os.getenv("DBNAME", "agent")

    # MCP服务
    MCP_URI = os.getenv("MCP_URI")

    # 高德地图MCP
    GAODE_MCP_URI = os.getenv("GAODE_MCP_URI")

    # 工具提示词的字数控制
    TOOL_DESCRIPTIONS_LIMIT = int(os.getenv("TOOL_DESCRIPTIONS_LIMIT", 2048))

    # 工具返回结果的字数控制
    TOOL_RESULTS_LIMIT = int(os.getenv("TOOL_RESULTS_LIMIT", 2048))

    # 会话记忆的字数控制
    CONVERSATIONS_LIMIT = int(os.getenv("CONVERSATIONS_LIMIT", 2048))

    # 迭代次数
    MAX_ITERATIONS = int(os.getenv("MAX_ITERATIONS", 5))